<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html>
  
  <head>    
    <title>How to add/edit/delete Zones in SMG1</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link href="../../styles.css" rel="stylesheet">
    <link rel="icon" href="../../images/icon.png">
	</head>

	<body>

    <div id="top">
      <h1>How to add/edit/delete Zones in SMG1</h1> 
    </div>
			
    <div id="hot-links">
      <h2>Direct links</h2>
      <hr>
      <ol>
        <li><a href="../../index.html">Introduction</a></li>
        <li><a href="../tutorials.html">Tutorials</a></li>
        <li><a href="../resources.html">Resources</a></li>
      </ol>
    </div>
			
    <div id="main">

			<h2>Contents</h2>
			<hr>
      <ol>
        <li><a href="#tools">Required tools</a></li>
        <li><a href="#layer-zone-scenario">About Layers, Zones and Scenarios</a></li>
        <li><a href="#steps">Steps</a></li>
      </ol>
      <br>

			<hr id="tools">
			<h2>Required tools</h2>
			<hr>
      <p>Go to <a href="../resources.html">Resources</a> for download links.</p>        
      <ul>
        <li>Whitehole Despag</li>
        <li>Whitehole for SMG1</li>
        <li>WiiExplorer</li>
        <li>Wiimm's ISO Tools (to get your SMG1 dump)</li>
      </ul>

			<hr id="layer-zone-scenario">
			<h2>About Layers, Zones and Scenarios</h2>
			<hr>

      <p> <b>Layers</b> serve as a way to group objects so they can only be shown on a <b>Zone</b> of a <b>Galaxy</b> in a certain <b>Scenario</b>. They can also be used to <b>categorize objects in a planet</b> so you can <b>edit objects separately</b> from other objects. They have a name that starts with <code>Layer</code> and ends with a <b>letter</b> (examples are <code>LayerA</code>, <code>LayerB</code>, <code>LayerC</code>, <b>etc.</b>).</p>
      
      <p><b>Zones</b> are a higher level of object grouping. They are <b>sections of a galaxy</b> and <b>can be placed anywhere inside of it</b>. They work for the purpose of <b>easing object placement around a Galaxy</b> using an offset respect to the Galaxy origin. They also work for optimization purposes (loading/unloading objects, at least that's what I believe).</p>
      
      <p>A <b>Scenario</b> is a combination of <b>Zones</b> and <b>Layers</b> with a <b>Star</b> that can be collected normally (end of the level) or when meeting a specific condition. It is basically <b>a level/mission on a Galaxy</b>. Their names are by default written in japanese but you can use latin characters to name them as well.</p>

      <br>

			<hr id="steps">
			<h2>Steps --- files used: <a href="https://archive.org/download/humming-owl-storage/GenericZone.zip">GenericZone.zip</a></h2>
			<hr>

      <p>Before adding a <b>new Zone</b> to a Galaxy you need an <b>ARC file</b> of the <b>Zone</b> in question. I've made a little <code>GenericZone.arc</code> <b>file</b> that can serve as a <b>new Zone template</b> for SMG1 for me, and for you, if you want to use it (download is in the <a href="#steps">Steps</a> title). Grab it and place it in the <code>StageData</code> <b>folder</b> (<b>Fig. 1</b>).</p>
      
      <img src="../../images/lc2/fig1.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 1 - Generic Zone Arc file placement)</p>
      <br>
      
      <hr>
      <p><b>NOTE 1:</b> The <code>GenericZone.arc</code> <b>file</b> shared has <b>all layers available</b> on it.</p>
      <hr>
      <br>
      
      <p>Now, add it to the <b>Zone list</b> of your <b>target Galaxy</b>. In my case I will add it to the <b>Comet Observatory</b> (<code>AstroGalaxy</code>, <b>Figs. 2 and 3</b>). In the Zone name field put the filename of the Zone Arc file, that in my case is <code>GenericZone</code>.</p>
      
      <img src="../../images/lc2/fig2.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 2 - Zone name field input)</p>
      <br>
      
      <img src="../../images/lc2/fig3.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 3 - Adding Generic Zone zone to <code>AstroGalaxy</code>)</p>
      <br>
      
      <hr>
      <p><b>NOTE 2:</b> The name of the <b>Zone</b> is exactly the same as the name of the <b>ARC file</b>. If you want to change the <code>GenericZone.arc</code> <b>file zone name</b> just change the name of the <b>ARC file</b> (<i>ez</i>). You can change the name of the ARC file to <code>potato.arc</code> and the <b>zone name</b> will be <code>potato</code>.</p>
      <hr>
      
      <br>
      
      <p>Remember to <b>save</b> your changes and you can now exit <b>Whitehole for SMG1</b>.</p>
      
      <p>With that done, the <b>Zone</b> will be already added to your <b>target Galaxy</b> and you will be able to see it on <b>Whitehole</b> and add objects to it (<b>Fig. 4</b>).</p>
      
      <img src="../../images/lc2/fig4.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 4 - <code>GenericZone</code> showing on target Galaxy in Whitehole)</p>
      <br>
      
      <p>To set the <b>position</b> and <b>rotations</b> of the <b>added Zone</b> in your <b>target Galaxy</b> go to <b>Whitehole's BCSV editor</b> and type the following in each field:</p>
      
      <p>- In the <b>Archive field</b> type <code>/StageData/[Galaxy Name].arc</code></p>
      
      <p>- In the <b>File field</b> type <code>/stage/jmp/placement/common/stageobjinfo</code></p>
      
      <p>where <code>[Galaxy Name]</code> is your <b>target Galaxy name</b>. Which in my case is <code>AstroGalaxy</code> (<b>Fig. 5</b>).</p>
      
      <img src="../../images/lc2/fig5.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 5 - Openning <code>AstroGalaxy</code>'s <code>stageobjinfo</code> file)</p>
      <br>
      
      <p><b>This file</b> (a <a href="https://luma.aurumsmods.com/wiki/BCSV_(File_format)">BCSV file</a>) is the file that <b>has the information of positions and rotations of all Zones in a Galaxy</b>. If a <b>Zone</b> does not show in here it is because the <b>Zone's default position</b> is 0,0,0 (x,y,z) and it <b>has no rotations</b> (0,0,0).</p>
      
      <p>To add your <b>Zone</b> click on <code>Add Row</code> and then enter the <b>Zone name</b>, the <code>l_id</code>, the <b>X, Y and Z positions</b> and the <b>angles each axis of the zone is rotated</b> respect to the <b>Galaxy</b> default axis (<b>X, Y and Z directions</b> in the XYZ Euler system AFAIK, <b>Fig. 6</b>).</p>
      
      <img src="../../images/lc2/fig6.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 6 - <code>GenericZone</code> added to <code>stageobjinfo</code> file)</p>
      <br>
      
      <hr>
      <p><b>NOTE 3:</b> The <code>l_id</code> <b>value</b> can be any <b>positive integer</b> but that isn't already associated to a <b>Zone</b> of the list.</p>
      <p><b>NOTE 4:</b> The <code>pos</code> and <code>dir</code> <b>values</b> can hold any number with <code>pos</code> being for <b>position units</b> and <code>dir</code> for <b>angle units</b> (degrees).</p>        
      <hr>
      
      <br>

      <p> And now we can see the <b>Zone</b> in action on <b>Whitehole</b> (<b>Fig. 7</b>). I added a <b>coin</b> to the <b>Zone</b> in its origin to appreciate the <b>translation</b> and <b>rotation</b> effects added on <b>Fig. 6</b>.</p>
      
      <img src="../../images/lc2/fig7.jpg" alt="Image could not be loaded.">
      <p class="idtext">(Fig. 7 - Coin added into the translated and rotated <code>GenericZone</code>)</p>
      <br>
      
      <hr>
      <p><b>NOTE 6:</b> Now that you know how to <b>add Zones</b> (to a <b>Galaxy</b>) you can apply the same principle to <b>delete/edit</b> them. Remember to use <b>Whitehole for SMG1</b>!</p>
      <p><b>NOTE 7:</b> To delete a <b>Zone</b> from a <b>Galaxy</b>, check the <code>stage/jmp/placement/common/stageobjinfo</code> file inside the <code>/StageData/[Galaxy Name].arc</code> and delete the <b>Zone</b> entry on <b>that file</b> (if there is one).</p>
      <hr>
      <br>

		</div>

	</body>

</html>
